package com.ssy.lingxi.system.model.request;

import javax.validation.Valid;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 新增会员注册资料接口参数VO
 * @author 万宁
 * @version 2.0.0
 * @date 2021-05-08
 */
public class MemberConfigAddVO implements Serializable {
    private static final long serialVersionUID = -8836583967580359923L;

    /**
     * 字段名称
     */
    @NotBlank(message = "字段名称不能为空")
    @Size(max = 24, message = "字段名称最长24个字符")
    private String fieldName;

    /**
     * 中文名称 字段注释名字
      */
    @NotBlank(message = "中文名称不能为空")
    @Size(max = 30, message = "中文名称最长30个字符")
    private String annotationName;

    /**
     * 标签类型
     */
    @NotBlank(message = "标签类型不能为空")
    private String fieldType;

    /**
     * 标签类型的额外属性（例如select的额外属性）
     */
    private Map<String, Object> attr;

    /**
     * 字段长度
     */
    private Integer fieldLength;

    /**
     * 是否为空
     */
    @NotNull(message = "'是否为空'属性值不能为空，取值范围为0-1")
    @Min(value = 0, message = "'是否为空'属性值不能为空，取值范围为0-1")
    @Max(value = 1, message = "'是否为空'属性值不能为空，取值范围为0-1")
    private Integer isNullState;

    /**
     * 分组名称
     */
    @NotBlank(message = "分组名称不能为空")
    @Size(max=30,message = "分组名称最长30个字符")
    private String groupName;

    /**
     * 排序
     */
    @NotNull(message = "排序值不能为空")
    @Positive(message = "排序值要大于0")
    private Integer sort;

    /**
     * 字段标签枚举值
     */
    @NotNull(message = "字段标签枚举值要大于等于0")
    @PositiveOrZero(message = "字段标签枚举值要大于等于0")
    private Integer tagEnum;

    /**
     * 变更需审核，0或Null-否，1-是
     */
    @NotNull(message = "'变更需审核属性'取值范围为0-1")
    @Min(value = 0, message = "变更需审核属性取值范围为0-1")
    @Max(value = 1, message = "变更需审核属性取值范围为0-1")
    private Integer validate;

    /**
     * 帮助信息
     */
    @Size(max=128,message = "帮助信息:最长128个字符")
    private String  help;

    /**
     * 规则类型枚举
     */
    @NotNull(message = "规则类型枚举值要大于等于0")
    @PositiveOrZero(message = "规则类型枚举值要大于等于0")
    private Integer ruleEnum;

    /**
     * 字段类型值列表
     */
    @Valid
    private List<MemberConfigLabelAddVO> fieldEnum;

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public String getAnnotationName() {
        return annotationName;
    }

    public void setAnnotationName(String annotationName) {
        this.annotationName = annotationName;
    }

    public String getFieldType() {
        return fieldType;
    }

    public void setFieldType(String fieldType) {
        this.fieldType = fieldType;
    }

    public Map<String, Object> getAttr() {
        return attr;
    }

    public void setAttr(Map<String, Object> attr) {
        this.attr = attr;
    }

    public Integer getFieldLength() {
        return fieldLength;
    }

    public void setFieldLength(Integer fieldLength) {
        this.fieldLength = fieldLength;
    }

    public Integer getIsNullState() {
        return isNullState;
    }

    public void setIsNullState(Integer isNullState) {
        this.isNullState = isNullState;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getTagEnum() {
        return tagEnum;
    }

    public void setTagEnum(Integer tagEnum) {
        this.tagEnum = tagEnum;
    }

    public Integer getValidate() {
        return validate;
    }

    public void setValidate(Integer validate) {
        this.validate = validate;
    }

    public String getHelp() {
        return help;
    }

    public void setHelp(String help) {
        this.help = help;
    }

    public Integer getRuleEnum() {
        return ruleEnum;
    }

    public void setRuleEnum(Integer ruleEnum) {
        this.ruleEnum = ruleEnum;
    }

    public List<MemberConfigLabelAddVO> getFieldEnum() {
        return fieldEnum;
    }

    public void setFieldEnum(List<MemberConfigLabelAddVO> fieldEnum) {
        this.fieldEnum = fieldEnum;
    }
}
